package com.mrjy.wechat.bo;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import com.mrjy.common.entity.WxAccount;
import com.mrjy.common.entity.WxAccountFans;
import com.mrjy.wechat.dto.MsgRequest;
import com.mrjy.wechat.process.MpAccount;

/**
 * 我的微信服务接口，主要用于结合自己的业务和微信接口
 */
public interface MyService {
	
	//消息处理
	public String processMsg(MsgRequest msgRequest,MpAccount mpAccount);

	//发布菜单
	public JSONObject publishMenu(String gid,MpAccount mpAccount);
	
	//删除菜单
	public JSONObject deleteMenu(MpAccount mpAccount);
	
	//获取用户列表
	public int syncAccountFansList(MpAccount mpAccount);
	
	//获取单个用户信息
	public WxAccountFans syncAccountFans(String openId, MpAccount mpAccount, boolean merge);
	
	//根据openid 获取粉丝，如果没有，同步粉丝
	public WxAccountFans getFansByOpenId(String openid,MpAccount mpAccount);
	
	//DB中Token
	public WxAccount getAccount(String account);

	//获取openid
	public JSONObject getOpenidByCode(String code, MpAccount mpAccount);

	
	/**
	 * DB绑定关系
	 * @param openid
	 * @param id
	 */
	public int binding(String openid, int id);

	/**
	 * 解除DB绑定关系
	 * @param id
	 */
	public int unbind(int id);

	/**
	 * 确定可绑定情况
	 * @param openid
	 * @param id
	 * @return
	 */
	public int checkInfo(String openid, int id);

	/**
	 * 获取用户openid列表
	 * @param mpAccount
	 * @return
     */
	public JSONArray syncAccountFansOpenidList(MpAccount mpAccount);
}



